home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.3 (Developer)…68k, x86, SPARC, PA-RISC] / NeXTSTEP 3.3 Dev Intel.iso / NextDeveloper / Headers / netinfo / _lu_types.x next >
Text File  |  1990-01-22  |  5KB  |  218 lines

  1. /*
  2.  * Lookup server protocol - Internal to NeXT
  3.  * Copyright (C) 1989 by NeXT, Inc.
  4.  * 
  5.  * This server uses a protocol based upon XDR layered on top of 
  6.  * a mach rpc call. There are three procedures defined in the "lookup.defs"
  7.  * file. A "lookup_link" operation takes a procedure string name and returns a
  8.  * number to be used in the other two calls. "lookup_all" takes a procedure
  9.  * number and XDR'd arguments and returns XDR'd results. It returns the
  10.  * entire list of entries. "lookup_one" has a similar calling convention,
  11.  * but returns only a single entry.
  12.  *
  13.  * The syntax of calls described here in comments looks like this:
  14.  *
  15.  *        result_type procedure_name(arg_type1 arg1, arg_type2 arg2, ...)
  16.  *
  17.  *    The arguments are assumed to be XDR'd in sequence and a single XDR'd
  18.  *     result is returned.
  19.  */
  20. const _LU_MAXLUSTRLEN = 256;
  21.  
  22. const _LU_MAXGRP = 256;
  23. const _LU_MAXHNAMES = 32;
  24. const _LU_MAXADDRS = 32;
  25. const _LU_MAXNNAMES = 32;
  26. const _LU_MAXPNAMES = 32;
  27. const _LU_MAXSNAMES = 32;
  28. const _LU_MAXRNAMES = 32;
  29. const _LU_MAXPRNAMES = 32;
  30. const _LU_MAXPRPROPS = 1024;
  31. const _LU_MAX_BOOTPARAMS_KV = 32;
  32. const _LU_MAXALIASMEMBERS = 1024;
  33.  
  34.  
  35. typedef string _lu_string<_LU_MAXLUSTRLEN>;
  36.  
  37.  
  38. /*
  39.  * Calls available:
  40.  *    int putpwpasswd(_lu_string long, _lu_string old, _lu_string new)
  41.  *     _lu_passwd * getpwuid(int uid)
  42.  *     _lu_passwd * getpwnam(_lu_string name)
  43.  *     _lu_passwd<> getpwent(void)
  44.  */
  45. struct _lu_passwd {
  46.     _lu_string pw_name;
  47.     _lu_string pw_passwd;
  48.     int pw_uid;
  49.     int pw_gid;
  50.     _lu_string pw_gecos;
  51.     _lu_string pw_dir;
  52.     _lu_string pw_shell;
  53. };
  54. typedef _lu_passwd *_lu_passwd_ptr;
  55.  
  56.  
  57. /*
  58.  * Calls available:
  59.  *     _lu_group * getgrgid(int gid)
  60.  *     _lu_group * getgrnam(_lu_string name)
  61.  *     _lu_group<> getgrent(void)
  62.  */
  63. struct _lu_group {
  64.     _lu_string gr_name;
  65.     _lu_string gr_passwd;
  66.     int gr_gid;
  67.     _lu_string gr_mem<_LU_MAXGRP>;
  68. };
  69. typedef _lu_group *_lu_group_ptr;
  70.  
  71. /*
  72.  * Calls available:
  73.  *     _lu_hostent * gethostbyaddr(unsigned long addr) -- IP only
  74.  *     _lu_hostent * gethostbyname(_lu_string name)
  75.  *     _lu_hostent<> gethostent(void)
  76.  */
  77. struct _lu_hostent {
  78.     _lu_string h_names<_LU_MAXHNAMES>;
  79.     unsigned long h_addrs<_LU_MAXADDRS>; /* IP only */
  80. };
  81. typedef _lu_hostent *_lu_hostent_ptr;
  82.  
  83. /*
  84.  * Calls available:
  85.  *     _lu_netent * getnetbyaddr(unsigned long addr) --IP only
  86.  *     _lu_netent * getnetbyname(_lu_string name)
  87.  *     _lu_netent<> getnetent(void)
  88.  */
  89. struct _lu_netent {
  90.     _lu_string n_names<_LU_MAXNNAMES>;
  91.     unsigned long n_net;    /* IP only */
  92. };
  93. typedef _lu_netent *_lu_netent_ptr;
  94.  
  95.  
  96. /*
  97.  * Calls available:
  98.  *     _lu_servent * getservbyport(int port, _lu_string proto)
  99.  *     _lu_servent * getservbyname(_lu_string name, _lu_string proto)
  100.  *     _lu_servent<> getservent(void)
  101.  */
  102. struct _lu_servent {
  103.     _lu_string s_names<_LU_MAXSNAMES>;
  104.     int s_port;
  105.     _lu_string s_proto;
  106. };
  107. typedef _lu_servent *_lu_servent_ptr;
  108.  
  109. /*
  110.  * Calls available:
  111.  *     _lu_protoent * getprotobynumber(int number)
  112.  *     _lu_protoent * getprotobyname(_lu_string name)
  113.  *     _lu_protoent<> getprotoent(void)
  114.  */
  115. struct _lu_protoent {
  116.     _lu_string p_names<_LU_MAXPNAMES>;
  117.     int p_proto;
  118. };
  119. typedef _lu_protoent *_lu_protoent_ptr;
  120.  
  121.  
  122. /*
  123.  * Calls available:
  124.  *     _lu_rpcent * getrpcbynumber(int number)
  125.  *     _lu_rpcent * getrpcbyname(_lu_string name)
  126.  *     _lu_rpcent<> getrpcent(void)
  127.  */
  128. struct _lu_rpcent {
  129.     _lu_string r_names<_LU_MAXRNAMES>;
  130.     int r_number;
  131. };
  132. typedef _lu_rpcent *_lu_rpcent_ptr;
  133.  
  134. /* 
  135.  * Calls available:
  136.  *     _lu_mntent<> getmntent(void)
  137.  */
  138. struct _lu_mntent {
  139.     _lu_string mnt_fsname;
  140.     _lu_string mnt_dir;
  141.     _lu_string mnt_type;
  142.     _lu_string mnt_opts;
  143.     int mnt_freq;
  144.     int mnt_passno;
  145. };
  146. typedef _lu_mntent *_lu_mntent_ptr;
  147.  
  148. /* 
  149.  * Calls available:
  150.  *    _lu_prdb_ent * prdb_getbyname
  151.  *     _lu_prdb_ent<> prdb_get(void)
  152.  */
  153. struct _lu_prdb_property {
  154.     _lu_string pp_key;
  155.     _lu_string pp_value;
  156. };
  157.  
  158. struct _lu_prdb_ent {
  159.     _lu_string pe_names<_LU_MAXPRNAMES>;
  160.     _lu_prdb_property pe_props<_LU_MAXPRPROPS>;
  161. };
  162. typedef _lu_prdb_ent *_lu_prdb_ent_ptr;
  163.  
  164.  
  165. /* 
  166.  * Calls available:
  167.  *    _lu_bootp_ent * bootp_getbyip(unsigned long addr)
  168.  *    _lu_bootp_ent * bootp_getbyether(opaque bootp_enaddr[6])
  169.  */
  170. struct _lu_bootp_ent {
  171.     _lu_string bootp_name;
  172.     _lu_string bootp_bootfile;
  173.     unsigned long bootp_ipaddr;
  174.     opaque bootp_enaddr[6];
  175. };
  176. typedef _lu_bootp_ent *_lu_bootp_ent_ptr;
  177.  
  178. /*
  179.  * Calls available:
  180.  *    _lu_bootparams_ent * bootparams_getbyname(_lu_string name)
  181.  */
  182. struct _lu_bootparams_ent {
  183.     _lu_string bootparams_keyvalues<_LU_MAX_BOOTPARAMS_KV>;
  184. };
  185. typedef _lu_bootparams_ent *_lu_bootparams_ent_ptr;
  186.  
  187.  
  188. /*
  189.  * Calls available:
  190.  *    _lu_aliasent * alias_getbyname(_lu_string name)
  191.  *    _lu_aliasent<> alias_getent(void)
  192.  */
  193. struct _lu_aliasent {
  194.     _lu_string alias_name;
  195.     _lu_string alias_members<_LU_MAXALIASMEMBERS>;
  196.     int alias_local;
  197. };
  198. typedef _lu_aliasent *_lu_aliasent_ptr;
  199.  
  200. /*
  201.  * Calls available:
  202.  *    int innetgr(_lu_innetgr_args args)
  203.  *    _lu_netgrent<> getnetgrent(_lu_string group)
  204.  */
  205. struct _lu_innetgr_args {
  206.     _lu_string group;
  207.     _lu_string *host;
  208.     _lu_string *user;
  209.     _lu_string *domain;
  210. };
  211.  
  212. struct _lu_netgrent{
  213.     _lu_string ng_host;
  214.     _lu_string ng_user;
  215.     _lu_string ng_domain;
  216. };
  217.  
  218.